package com.liujit.pay.wx.enums;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description: 退款渠道
 * @author: liujun
 * @create: 2021/2/19 2:23 下午
 **/
@Getter
@AllArgsConstructor
public enum RefundsChannel {
    /**
     * 原路退款
     */
    ORIGINAL("ORIGINAL", "原路退款"),
    /**
     * 退回到余额
     */
    BALANCE("BALANCE", "退回到余额"),
    /**
     * 原账户异常退到其他余额账户
     */
    OTHER_BALANCE("OTHER_BANKCARD", "原账户异常退到其他余额账户"),
    /**
     * 原银行卡异常退到其他银行卡
     */
    OTHER_BANKCARD("OTHER_BANKCARD", "原银行卡异常退到其他银行卡");

    private String channel;

    private String name;

    public static String getName(String channel) {
        for (RefundsChannel refundsChannel : RefundsChannel.values()) {
            if (StrUtil.equals(channel, refundsChannel.getChannel())) {
                return refundsChannel.getName();
            }
        }
        return null;
    }
}
